home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / SH / STD / STDC / TIME.H < prev    next >
C/C++ Source or Header  |  1992-07-13  |  951b  |  45 lines

  1. /* time, time/date conversion */
  2.  
  3. #if ! _TIME_H
  4. #define    _TIME_H 1
  5.  
  6. #include <stddef.h>        /* need size_t */
  7.  
  8. #ifndef sparc
  9. typedef long time_t;
  10. typedef long clock_t;        /* seconds/CLK_TCK */
  11. #endif
  12.  
  13. #if _V7 || _SYSV
  14. #define    CLK_TCK    60        /* todo: get from <sys/param.h> */
  15. #endif
  16.  
  17. #if _BSD
  18. #define    CLK_TCK    100
  19. #endif
  20.  
  21. #if _ST
  22. #define    CLK_TCK    200        /* ST system clock */
  23. #endif
  24.  
  25. struct tm {
  26.     int    tm_sec, tm_min, tm_hour;
  27.     int    tm_mday, tm_mon, tm_year, tm_wday, tm_yday;
  28.     int    tm_isdst;
  29.     long    tm_gmtoff;    /* BSD */
  30.     char   *tm_zone;    /* BSD */
  31. };
  32.  
  33. clock_t    clock ARGS((void));
  34. time_t    time ARGS((time_t *tp));
  35. #define    difftime(t1, t2)    (double)((t2)-(t1))
  36. time_t    mktime ARGS((struct tm *tmp));
  37. char   *asctime ARGS((const struct tm *tmp));
  38. char   *ctime ARGS((const time_t *tp));
  39. struct tm *gmtime ARGS((const time_t *tp));
  40. struct tm *localtime ARGS((const time_t *tp));
  41. size_t    strftime ARGS((char *buf, size_t len, const char *fmt, const struct tm *tmp));
  42.  
  43. #endif
  44.  
  45.